Knowledge Base
Introduction
The Knowledge Base (KB) in Lyzr enables AI agents to retrieve and utilize structured and unstructured information effectively. By leveraging KB, agents can answer queries with accurate, contextually relevant responses.
The KB can store information in various formats, such as text, documents, and links, and it supports different retrieval mechanisms to enhance accuracy.
Creating a Knowledge Base
Lyzr provides an interface to create and manage Knowledge Bases through the Lyzr Studio. You can either create a new KB or use an existing one by configuring it in the agent.
Available Retrieval Types
Lyzr supports different retrieval mechanisms, allowing flexible and optimized data fetching.
a) Basic Retrieval
- Standard retrieval mechanism.
- Uses vector similarity matching to fetch relevant documents.
- Suitable for general-purpose knowledge extraction.
b) MMR (Maximal Marginal Relevance)
- Ensures diverse and relevant results.
- Reduces redundancy by balancing relevance and diversity.
- Best for cases where varied perspectives are needed.
c) HyDE (Hypothetical Document Embeddings)
- Generates synthetic documents to enhance query relevance.
- Improves retrieval quality for open-ended queries.
- Useful when existing data lacks explicit context.
Chunking Strategy
Chunking is a critical part of KB management that helps break large documents into manageable parts.
Parameters:
- Number of chunks: Determines how documents are split.
- Chunk size: Controls the granularity of document segmentation.
- Overlap settings: Helps maintain context continuity between chunks.
Managing Knowledge Base Content
Once a KB is created, it can be managed in Lyzr Studio:
a) Adding Content:
- Upload new documents.
- Add text-based knowledge entries.
- Provide URLs to fetch external information.
b) Deleting Content:
- Remove outdated or incorrect entries.
- Adjust knowledge base structure as needed.
c) Updating Retrieval Parameters:
- Modify retrieval type for better accuracy.
- Adjust chunking strategy based on document complexity.
Conclusion
Using the Knowledge Base in Lyzr, AI agents can effectively retrieve structured information, improving the accuracy and reliability of responses. By configuring the retrieval type, chunking settings, top-k parameters, and top_p, users can optimize AI performance based on specific application needs.